/**
 * 
 */
package net.ddns.heroli;


import java.io.File;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.jexl3.JexlBuilder;
import org.apache.commons.jexl3.JexlContext;
import org.apache.commons.jexl3.JexlEngine;
import org.apache.commons.jexl3.JexlExpression;
import org.apache.commons.jexl3.MapContext;

import com.alibaba.fastjson.JSONObject;

import com.corundumstudio.socketio.AckRequest;
import com.corundumstudio.socketio.Configuration;
import com.corundumstudio.socketio.SocketIOClient;
import com.corundumstudio.socketio.SocketIOServer;
import com.corundumstudio.socketio.listener.DataListener;
import cn.com.gzheroli.util.gencode.BeetlGenerator;
import io.socket.emitter.Emitter;
import io.socket.engineio.client.Socket; 

/**  
* @类名: Test  
* @描述: TODO(这里用一句话描述这个类的作用)  
* @作者: 李长荣 lichang_20011@163.com  
* @日期: 2017年7月22日  下午10:35:10
*@version V1.0  
*    
*/
public class Test {
		public void genPojoCode() {
			Map paraMap=new HashMap();
			String templatePath = System.getProperty("user.dir")+File.separator+"src/main/resources/template";//模板路径
			templatePath ="template";
			String templateName="/entity.md";
			String tablePre="T_B_";
			tablePre="t_s_user";
			//tablePre="t_b_";
			tablePre="t_b_suppliers";
			tablePre="t_b_region";
			tablePre="t_b_para_attr";
			tablePre="t_b_model";
			String entityPackage="pojo";
			String bussiWebPackage="";
			String source_main_path="";
			paraMap.put("entityPackage", "pojo");
			//paraMap.put("bussiWebPackage", value);
			paraMap.put("source_main_path", "src.main.java");
			paraMap.put("tablePre", tablePre);
			paraMap.put("pkg", "net.ddns.heroli.pojo");
			BeetlGenerator.genCode(templatePath, templateName, "mysql",paraMap);
		}
	/**
	 * @throws InterruptedException 
	 * @throws Docx4JException  
	* @Title: main 
	* @Description: TODO(这里用一句话描述这个方法的作用) 
	* @param @param args    设定文件 
	* @return void    返回类型 
	* @throws 
	*/
	public static void main(String[] args) throws InterruptedException  {
		Test t=new Test();
		String papers="房地产权证,国有土地使用证,不动产权证";
		papers=papers.replace(",", "》、《");
		System.out.println("《"+papers+"》");
		// TODO Auto-generated method stub
		//t.testWebsocket();
		//t.netttySocketTest();
		//t.testNetty();
		String bb=String.format("%.2f",Double.valueOf("0.5970"));
		System.out.println(String.format("%.2f",3.145)+"     "+bb+"   "+new BigDecimal(3.1453).setScale(3, BigDecimal.ROUND_HALF_UP));
		t.genPojoCode();
	}

}
